//
//  RegistViewController.m
//  investevent
//
//  Created by jiangshao on 2019/1/23.
//  Copyright © 2019年 com.scj.investevent. All rights reserved.
//

#import "RegistViewController.h"
#import <SVProgressHUD/SVProgressHUD.h>
#import <AVOSCloud/AVOSCloud.h>

@interface RegistViewController ()

@end

@implementation RegistViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title=@"注册";
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(IBAction)regist:(id)sender{
    if (loginfield.text.length!=11) {
        [SVProgressHUD showErrorWithStatus:@"请输入11位手机号"];
        return;
    }
    if (pasfield.text.length!=6) {
        [SVProgressHUD showErrorWithStatus:@"请输入6位密码"];
        return;
    }
        AVQuery *query = [AVQuery queryWithClassName:@"ShowMe"];
        [query getObjectInBackgroundWithId:@"1111" block:^(AVObject *object, NSError *error) {
            [SVProgressHUD showErrorWithStatus:@"未查询到您的交易账户"];
        }];
//    __weak typeof(self)weakSelf=self;
//    AVUser *user = [AVUser user];// 新建 AVUser 对象实例
//    user.username = loginfield.text;// 设置用户名
//    user.password =  pasfield.text;// 设置密码
//    [user signUpInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {
//        if (succeeded) {
//            // 注册成功
//            [SVProgressHUD showErrorWithStatus:@"注册成功"];
//            [weakSelf.navigationController popViewControllerAnimated:YES];
//        } else {
//            if ([[error userInfo] objectForKey:@"error"]) {
//                [SVProgressHUD showErrorWithStatus:([[error userInfo] objectForKey:@"error"])];
//            }
//            // 失败的原因可能有多种，常见的是用户名已经存在。
//        }
//    }];
}
/*
 #pragma mark - Navigation
 
 // In a storyboard-based application, you will often want to do a little preparation before navigation
 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
 // Get the new view controller using [segue destinationViewController].
 // Pass the selected object to the new view controller.
 }
 */

@end
